/*
 * @lc app=leetcode.cn id=704 lang=rust
 *
 * [704] 二分查找
 */
struct Solution;
// @lc code=start
impl Solution {
    pub fn search(nums: Vec<i32>, target: i32) -> i32 {
        nums.binary_search(&target).map_or(-1, |x| x as i32)
    }
}
// @lc code=end
